import { defineStore } from "pinia";
import { ref } from 'vue'
import { getBlogSettingsDetail } from '@/api/frontend/blogsettings'

export const useBlogSettingsStore = defineStore('blogsettings', () => {
  // 博客的设置信息
  const blogsettingInfo = ref({})

  // 获取博客设置信息
  const getBlogSettings = async () => {
    // 调用后台获取博客设置信息接口
    const res = await getBlogSettingsDetail()
    if (res.success == true) {
      blogsettingInfo.value = res.data
    }
  }

  return { blogsettingInfo, getBlogSettings }
})